package com.csaba.connector.otp.parser;

import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;

public class OTPCodes
{
	public final static String RP_DIA = "dia";
	public final static String RP_GWBID = "gwbid";
	public final static String RP_STARTING_DATE = "startingDate";
	public static final String RP_LASTTOKEN = "last_token";

	public static final String RP_ACCOUNT_DETAILS_URL = "otp.AccountDetailsURL";
	public static final String RP_ACCOUNT_LIST = "otp.AccountList";
	public static final String CACHE_ACCOUNT_LIST_REQUEST = "cache.accountList.request";

	public final static Charset HTML_CHARSET = Charset.forName("iso-8859-2");

	public final static ThreadLocal<DecimalFormat> amountFormat = new ThreadLocal<DecimalFormat>()
	{
		@Override
		protected DecimalFormat initialValue()
		{
			final DecimalFormat amount = new DecimalFormat("#,##0");
			final DecimalFormatSymbols symb = new DecimalFormatSymbols();
			symb.setGroupingSeparator('.');
			symb.setDecimalSeparator(',');
			amount.setDecimalFormatSymbols(symb);
			return amount;
		}
	};

	public final static ThreadLocal<SimpleDateFormat> dateFormat = new ThreadLocal<SimpleDateFormat>()
	{
		@Override
		protected SimpleDateFormat initialValue()
		{
			final SimpleDateFormat date = new SimpleDateFormat("yyyy.MM.dd");
			return date;
		}
	};

}
